From 7e80c684cad3249923b05ecbe02c009b111d9b9f Mon Sep 17 00:00:00 2001 From: Ewan Higgs Date: Mon, 27 Feb 2017 01:13:07 +0100 Subject: [PATCH] Fix for #3722 When using init, add [[bin]] and [lib] section where appropriate. --- src/cargo/ops/cargo_new.rs | 59 +++++++++++++++++++++++++++++--------- tests/init.rs | 53 +++++++++++++++++++++++++++------- 2 files changed, 88 insertions(+), 24 deletions(-) diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index d211dc3e9..993e85b4d 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -10,6 +10,7 @@ use term::color::BLACK; use handlebars::{Handlebars, no_escape}; use tempdir::TempDir; +use toml; use core::Workspace; use sources::git::clone; @@ -44,6 +45,7 @@ struct MkOptions<'a> { path: &'a Path, name: &'a str, bin: bool, + source_files: Vec, } impl Decodable for VersionControl { @@ -127,11 +129,40 @@ fn get_input_template(config: &Config, opts: &MkOptions) -> CargoResult